<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>审批</title>
    <link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" href="../../css/instruction.css">
    <script src="../../js/vue.js"></script>
    <script src="../../js/mui.min.js"></script>
    <script src="../../js/jquery.min.js"></script>
    <style>
        /*.active{*/
        /*background-image: url('../../images/u82.png');*/
        /*}*/
    </style>
</head>
<body>
<div id="app">
    <header class="mui-bar mui-bar-nav">
        <span class="back" @click="back"></span>
        <!--<span class="cross"></span>-->
        <h1 class="mui-title">审批</h1>
    </header>
    <div class="mui-content">
        <ul class="report-type">
            <li>
                <a href="###" onClick="window.location.href='addApproval.html?cid='+Request.cid+'&'+'loginName='+Request.loginName">
                    <div class="active"></div>
                    <p>工作请示</p>
                </a>
            </li>
            <div class="clear"></div>
        </ul>
        <!--<ul class="home-footer">
            <li>
                <a href="###" onClick="window.location.href='addApproval.html?cid='+Request.cid+'&'+'loginName='+Request.loginName">
                    <div class="approve-write home-footer-style"></div>
                    <p>写申请</p>
                </a>
            </li>
            <li>
                <a href="###" onClick="window.location.href='approval_record.html?cid='+Request.cid+'&'+'loginName='+Request.loginName">
                    <div class="approve-look home-footer-style"></div>
                    <p>查看审批</p>
                </a>
            </li>
            <div class="clear"></div>
        </ul>-->
        <ul class="home-footer">
            <li>
                <a href="###" onClick = handleClick("addApproval.html")>
                    <div class="home-footer-style approve-write-click"></div>
                    <p>写申请</p>
                </a>
            </li>
            <li>
                <a href="###" onClick = handleClick("approval_record.html")>
                    <div class="home-footer-style approve-look"></div>
                    <p>查看审批</p>
                </a>
            </li>
            <div class="clear"></div>
        </ul>
    </div>
</div>
<script>
    function UrlSearch() {
        var name, value;
        var str = location.href; //取得整个地址栏
        var num = str.indexOf("?");
        str = str.substr(num + 1); //取得所有参数   stringvar.substr(start [, length ]
        var arr = str.split("&"); //各个参数放到数组里
        for (var i = 0; i < arr.length; i++) {
            num = arr[i].indexOf("=");
            if (num > 0) {
                name = arr[i].substring(0, num);
                value = arr[i].substr(num + 1);
                this[name] = value;
            }
        }
    }

    var Request = new UrlSearch(); //实例化

    if(typeof(Request.cid) == "undefined" || typeof(Request.loginName) == "undefined"){
        mui.toast("请重新登录");
    }else {
        function sendInfoToJava(name) {
            //调用android程序中的方法，并传递参数
            javascript:WebView.showInfoFromJs(name);
        }

        $(function () {
            var app = new Vue({
                el: "#app",
                data:function(){
                    return{
                        isActive:true,
                        text:"明明"
                    }
                },
                methods: {
                    back: function () {
                        var name = "back";
                        sendInfoToJava(name);
                    }
                }
            })
        })
        var handleClick = function(url){
            window.location.href= url + '?cid=' + Request.cid + '&' + 'loginName=' + Request.loginName
        }
    }

</script>
</body>
</html>